require("@babel/register")({ ignore: [/node_modules/] });
const Koa = require("koa");
const { koaBody } = require("koa-body");
const cors = require("@koa/cors");
const { getIPAddress } = require("./utils/index");

const app = new Koa();

app.use(koaBody()); // 解析请求体
app.use(cors()); // 处理CORS（跨域资源共享）问题

app.use(require("./router/nav.get").routes());
app.use(require("./router/nav.set").routes());

app.listen(3000, () => {
  console.log(`http://${getIPAddress()}:3000`);
});
